﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BTCairo
{
    public class DataFlowDiagram : AbstractFactory
    {
        public override AbstractFactory CloneFactory()
        {
            DataFlowDiagram temp = new DataFlowDiagram();
            return temp;
        }
        public override void DrawCondition()
        {

        }

        public override void DrawEnd()
        {

        }

        public override void DrawInPut()
        {

        }

        public override void DrawJump()
        {

        }

        public override void DrawOutPut()
        {

        }

        public override void DrawProcess()
        {

        }

        BasicEllipse ellipseStart;
        BasicText textStart;
        public override void DrawStart(CommonGraphics cg, int x, int y, int w, int h)
        {
            CommonGraphics tempGraphic = cg.CloneCommonGraphic();
            tempGraphic.MyInfoGraphic.fill = false;
            int value = Math.Min(w, h);
            ellipseStart = new BasicEllipse(tempGraphic, x, y, value, value);
            textStart = new BasicText(tempGraphic, x + 10, y + 10, "1", 30);////////////

            ellipseStart.Draw();
            textStart.Draw();
        }
        public override void DrawStart(CommonGraphics cg)
        {
            InfoGraphic info = cg.MyInfoGraphic;
            int x = info.x;
            int y = info.y;
            int w = info.widthShape;
            int h = info.heightShape;
            CommonGraphics tempGraphic = cg.CloneCommonGraphic();
            tempGraphic.MyInfoGraphic.fill = false;
            int value = Math.Min(w, h);
            ellipseStart = new BasicEllipse(tempGraphic, x, y, value, value);
            textStart = new BasicText(tempGraphic, x + 10, y + 10, "1", 30);////////////

            ellipseStart.Draw();
            textStart.Draw();
        }
        public override void ParseXmlElementStart(System.Xml.XmlDocument doc, System.Xml.XmlElement root)
        {
            ellipseStart.ParseXmlElement(doc, root);
            textStart.ParseXmlElement(doc, root);
        }
    }
}
